package com.xoa.controller.emergency;

import com.xoa.model.emergency.CpAssetType;
import com.xoa.service.emergency.CpAssetTypeService;
import com.xoa.util.LimsJson;
import com.xoa.util.ToJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @作者 杨岩林
 * @创建日期 14:222019/10/16
 * @类介绍
 */
@Controller
@RequestMapping("cpAssetsType")
public class CpAssetsTypeController {
    @Autowired
    private CpAssetTypeService cpAssetTypeService;

    @RequestMapping("showYjType")
    @ResponseBody
    public LimsJson showYjType(){
        return cpAssetTypeService.queryYjType();
    }

    @RequestMapping("showChild")
    @ResponseBody
    public LimsJson showChild(Integer parentId){
        return cpAssetTypeService.queryChild(parentId);
    }

    @RequestMapping("insertCpType")
    @ResponseBody
    public ToJson insertCpType(CpAssetType cpAssetType){
        return cpAssetTypeService.insertCpType(cpAssetType);
    }

    @RequestMapping("delCpType")
    @ResponseBody
    public ToJson delCpType(Integer typeId){
        return cpAssetTypeService.delCpType(typeId);
    }

}
